<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        let array = [1, 2, 3, 4, 5]
        // let array1 = array.map((item, index) => {
        //     console.log({item, index});
        //     return {name:item}
        // })
        let array1 = []
        array.forEach(item =>{
            array1.push({name:item})
        })
        console.log(array1);


    //  [{name:1}]
    </script>
</head>

<body>

</body>

</html>